package br.com.tcc.systemdx.persistence.hibernate;

import java.util.List;

import org.hibernate.FetchMode;
import org.hibernate.criterion.Restrictions;
import org.hibernate.mapping.Map;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import br.com.tcc.systemdx.domain.ValorFatorRelevante;
import br.com.tcc.systemdx.persistence.ValorFatorRelevanteDAO;

@Repository(ValorFatorRelevanteDAO.BEAN_NAME)
@Transactional
public class ValorFatorRelevanteHibernateDAOImpl extends
		AbstractEntityHibernateDAOImpl<ValorFatorRelevante> implements
		ValorFatorRelevanteDAO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 588306612802724581L;
	
	//@Override
	public ValorFatorRelevante obterPorValorId(
			Long valorId) {
		return findById(valorId);
	}

	public List<ValorFatorRelevante> procurarTodosPorTitulo(String titulo){
		// not working?
		return findByCriteria(Restrictions.ilike("valor.titulo", titulo));
	}



}
